import MyContext from "./Context";
import React from "react";

const ChildCount = () => {
  const { store, dispatch } = React.useContext(MyContext);

  console.log("DEMO1: re-render ChildCount", store.count);
  return (
    <div className="Child-container">
      <div>count is: {store.count}</div>
      <button onClick={() => dispatch({ type: "addCount" })}> AddCount </button>
    </div>
  );
};

export default ChildCount;
